﻿@model MvcApplication6.Models.AdminImage
Page: @Model.pageIndex |
        @if (Model.pageIndex > 1) {
            @Ajax.ActionLink(
                      "Previous",
                     "PagingImage",
                     "Image",  // <-- Controller Name.
                         new
                         {
                             pageIndex = (@Model.pageIndex - 1),
                         }, // <--
                        new AjaxOptions
                        {
                            HttpMethod = "GET",
                            InsertionMode = InsertionMode.Replace,
                            UpdateTargetId = "ajaxImage"
                        }
            )
        }
        
        @Ajax.ActionLink(
                      "Next",
                     "PagingImage",
                     "Image",  // <-- Controller Name.
                         new
                         {
                             pageIndex = (@Model.pageIndex + 1),
                         }, // <--
                        new AjaxOptions
                        {
                            HttpMethod = "GET",
                            InsertionMode = InsertionMode.Replace,
                            UpdateTargetId = "ajaxImage"
                        }
        )
<ul style="display: block;" class="display">
@if (@Model.listImage.Count > 0)
{
    foreach (var image in Model.listImage)
    {
         <li>
            <div class="content_block">
                <a href="#"><img src=../../Upload/Images/@image.name alt=""></a>
                <h2><a href="#">@image.name</a></h2>
            </div>
        </li>
     
    }
}
else { 
    <h2><a href="#">Không có hình ảnh</a></h2>
}
     

</ul>